/*****************************************************************************
 * Copyright (C) Stacy Curl. All rights reserved.                            *
 * ------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the BSD      *
 * style license a copy of which has been included with this distribution in *
 * the LICENSE.txt file.                                                     *
 *****************************************************************************/
package picounit.features.story;

import picounit.StoryRunnerAPI;
import picounit.features.base.Caller;
import picounit.features.base.PicoUnitImpl;
import junit.framework.Test;

public class StoryRunnerImpl implements StoryRunnerAPI {
	private static final int STACK_DISTANCE_TO_CALLER = 3;

	private final PicoUnitImpl picoUnitImpl;

	public StoryRunnerImpl(String name, Class type) {
		this.picoUnitImpl = null;//new PicoUnitImpl(name, type);

//		RegistryImpl registry = (RegistryImpl) picoUnitImpl.get(Registry.class);
//
//		MutablePicoContainer picoContainer = registry.picoContainer();
//
//		MockFactory mockFactory = (MockFactory) picoUnitImpl.get(MockFactory.class);
//
//		registry.replacePicoContainer(new DefaultPicoContainer(
//			new StubbingComponentAdapterFactory(mockFactory), picoContainer));
	}

	public Test generateJUnitTest() {
		return picoUnitImpl.generateJUnitTest(new Caller(STACK_DISTANCE_TO_CALLER).callingClass());
	}
}
